package com.tjc.controller;

import com.tjc.domain.Account;
import com.tjc.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * Created by hongcaixia on 2020/1/4.
 */
@Controller
@RequestMapping("/account")
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("findAll")
    public String findAll(Integer eid,String pwd){
        System.out.println("web：findAll方法执行了");
        boolean flag = accountService.findAll(eid,pwd);
        if (flag){
            return "success";
        }else{
            return "f";
        }


    }

    @RequestMapping("/save")
    public String save(Account account){
        System.out.println("web：save方法执行了");
        accountService.saveAccount(account);
        return "success";
    }
}
